import {
  AxesHelper,
  GridHelper,
  SpotLightHelper,
  PointLightHelper,
  SkeletonHelper,
} from 'three'
import { pointLight, spotLight } from './Tlights'
import { skinnedMesh } from './TSKeleton'

export const helperList = []
const axesHelper = new AxesHelper(500) //坐标辅助线
axesHelper.raycast = () => {} //重写投射射线回调，在射线发射器上不会返回该目标
const gridHelper = new GridHelper(
  500,
  30,
  'rgb(200,200,100)',
  'rgb(100,100,100)'
) //网格辅助线
gridHelper.raycast = () => {}

const pointLightHelper = new PointLightHelper(
  pointLight,
  pointLight.distance,
  'white'
)
pointLightHelper.raycast = () => {}

const spotLightHelper = new SpotLightHelper(spotLight, 'white')
// 聚光灯特殊
spotLightHelper.raycast = () => {}
spotLightHelper.children.forEach((object) => {
  object.raycast = () => {}
})

// 添加骨骼辅助显示
const skeletonHelper = new SkeletonHelper(skinnedMesh)
skeletonHelper.material.linewidth = 10
skeletonHelper.children.forEach((object) => {
  object.raycast = () => {}
})

helperList.push(axesHelper, gridHelper, spotLightHelper, skeletonHelper)
